# Maintainer: Morten Linderud <foxboron@archlinux.org>
# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>

pkgname=bolt
pkgver=0.9.6
pkgrel=1
pkgdesc="Thunderbolt 3 device manager"
arch=('loong64' 'x86_64')
url="https://gitlab.freedesktop.org/bolt/bolt"
license=('LGPL')
depends=('polkit' 'systemd')
makedepends=('asciidoc' 'meson' 'python-setuptools' 'patch')
checkdepends=('umockdev')
source=(https://gitlab.freedesktop.org/$pkgname/$pkgname/-/archive/$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('87b442645e8dc06bc4cb3718b6ba8bff6e91401f642aeff83cc4274d633b38fe')

build() {
  cd $pkgname-$pkgver

  arch-meson ../build
  ninja -v -C ../build
}

check() {
  cd $pkgname-$pkgver

  meson test -C ../build --print-errorlogs
}

package() {
  cd $pkgname-$pkgver

  DESTDIR="${pkgdir}" meson install -C ../build
  install -d -o root -g 102 -m 750 "$pkgdir/usr/share/polkit-1/rules.d"
}
